/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package multiface.web;

import java.util.Date;

/**
 *
 * @author Diego64
 */
public class Util {

    /* convert from UTF-8 encoded HTML-Pages -> internal Java String Format */
    public static String convertFromUTF8(String s) {
        String out = null;
        try {
            out = new String(s.getBytes("ISO-8859-1"), "UTF-8");
        } catch (java.io.UnsupportedEncodingException e) {
            return null;
        }
        return out;
    }

    /* convert from internal Java String Format -> UTF-8 encoded HTML/JSP-Pages  */
    public static String convertToUTF8(String s) {
        String out = null;
        try {
            out = new String(s.getBytes("UTF-8"));
        } catch (java.io.UnsupportedEncodingException e) {
            return null;
        }
        return out;
    }
    
    public static Date getData(long ms){
        return new Date(ms);
    }
}
